package com.cskaoyan.controller.wx;


import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.Topic;
import com.cskaoyan.service.TopicService;
import com.cskaoyan.service.wxService.WxTopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("wx/topic")
public class WxTopicController {

    @Autowired
    WxTopicService  wxTopicService;

    @RequestMapping("related")
    public BaseRespVo related(Integer id){
        List<Topic> data = wxTopicService.wxTopicRelated(id);
        return BaseRespVo.ok(data);
    }

    @RequestMapping("list")
    public BaseRespVo list(Integer page,Integer size) {
        Map data = wxTopicService.wxTopicList(page,size);
        return BaseRespVo.ok(data);
    }

    @RequestMapping("detail")
    public BaseRespVo detail(Integer id) {
        Map data = wxTopicService.wxTopicDetail(id);
        return BaseRespVo.ok(data);
    }

}
